package com.jd.org.domain;

import com.jd.basic.domain.BaseDomain;
import com.jd.basic.utils.MD5Utils;
import com.jd.basic.utils.StrUtils;
import com.jd.user.domain.Logininfo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author 小林同学
 * @version 1.0
 * @description: TODO
 * @date 2023/2/21 22:34
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Employee  extends BaseDomain {
    private String username;
    private String phone;
    private String email;
    private String salt;
    private String password;
    private Integer age;
    private Integer state;
    private Long departmentId;
    private Long logininfoId;
    private Long shopId;
    private Department department;

    private List<Long> roles;



    public Logininfo getLogininfo(Employee employee){

        return Logininfo.builder()
                        .email(this.email)
                        .password(this.password)
                        .phone(this.phone)
                        .username(this.username)
                        .salt(this.salt)
                        .type(0)
                        .disable(true)
                        .build();
    }

}
